<template>
	<view class="main-class">
		<tn-sticky>
			<view class="header-class tn-flex justify-end" >
				<view class="status_bar" style="height: var(--status-bar-height); width: 100%; "></view>			
				<!-- <view class="tn-color-black_text tn-flex justify-between tn-text-xl tn-pl-xl tn-pr-xl tn-pb-xl" >
					<tn-icon name="title" size="1"/>
					<span class="tn-white_text">密码修改</span>
					<tn-icon name="title" size="1" />
				</view> -->
				<tn-navbar height="45px" home-icon="" :bottom-shadow = "false" bg-color="tn-type-primary_bg" >信息注册 </tn-navbar>
				
			</view>
		</tn-sticky>
		
		<tn-form label-position="top" class="form-class tn-m">
		  <tn-form-item label="企业名称:" label-position="left">
		    <tn-input v-model="userInfo.entName" />
		  </tn-form-item>
		  <tn-form-item label="地&ensp;&ensp;&ensp;&ensp;址:" label-position="left">
		    <tn-input v-model="userInfo.address" />
		  </tn-form-item>
		  <tn-form-item label="用&ensp;户&ensp;名:" label-position="left">
		    <tn-input v-model="userInfo.lgnName" />
		  </tn-form-item>
		  <tn-form-item label="密&ensp;&ensp;&ensp;&ensp;码:" label-position="left">
		    <tn-input v-model="userInfo.password"  type="password"/>
		  </tn-form-item>
		</tn-form>
		
		<button class="button-class" @click="doRegister"> 提  &ensp; &ensp;交 </button>
		
	</view>
	
	
</template>

<script setup>
	import { ref,reactive,onMounted } from 'vue'
	import { postNoCall } from '@/api/index.js'
	import { EventBus } from '@/mitt/EventBus.js';
	import { toastMessage } from '@/utils/toast.js'
	import md5 from "js-md5";
	import {createParams} from '@/utils/utils.js'
	const procName = "PROC_APP_DO_REGISTER";
	
	const userInfo = reactive({});
	
	let loginInfo = {};
	
	onMounted(()=>{
		loginInfo = uni.getStorageSync("LOGINUSER");
	})
	
	let doRegister = () =>{
		let params = {};
		params["P_PWD"] = md5(userInfo.password);
		params["P_ACTION"] = "REGIST";
		params["P_PROC_NAME"] = procName;
		postNoCall(Object.assign(params,createParams(userInfo)) ).then(res=>{
			if(res){
				if(res.code === 200 ){
					toastMessage("已提交，请等待审核！");
				}
			}
			
		})
	}

</script>

<style scoped>
.header-class{
	height: 17vh !important;
	flex-direction: column
}
.form-class{
	width: 90vw;
	margin-left: 5vw;
}
.button-class{
	margin-top: 5vh;
	width: 90vw;
	border-radius: 40px !important;
	/* color: #FFFFFF !important; */
	background: linear-gradient(to right,  #47e8be,#3379dc);
	/* border: 0px solid rgba(0, 0, 0, 0.2) !important; */
}

.button-class::after{
	border: 0px solid rgba(0, 0, 0, 0.2) !important;
}
</style>
